package collections.my;

import java.util.LinkedList;
import java.util.List;

public class LinkedListTest {

	public static void main(String[] args) {
		
		List<String> ll = new LinkedList<String>();
		
		ll.add("1");		
		ll.add("2");		
		ll.add("3");
		ll.add("4");
		ll.add("5");
		
		for (String string : ll) {
			System.out.println(string);
		}
		
		try {
			System.out.println(ll.get(10));
		} catch (IndexOutOfBoundsException e) {
			System.out.println("exeption catched");
		}
		
		for (String string : ll) {
			System.out.println(string);
		}

		System.out.println("=========");
		
		for (String string : ll) {
			System.out.println(string);
			if (string.equals("3"))
			{
				break;
			}
		}
		
	}
	
}
